<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="java.util.ArrayList"%>
<%@page import="projectodedalo.modelo.Usuario"%>
<%@page import="projectodedalo.modelo.Idea"%>
<%@page import="projectodedalo.modelo.Reunion"%>
<%@page import="java.util.Iterator"%>
<%!
	private int calificadoAsesor=0;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>:: Registrar Reuniones ::</title>
<script type="text/javascript" src="lib/alertify.js"></script>
<link rel="stylesheet" href="themes/alertify.core.css" />
<link rel="stylesheet" href="themes/alertify.default.css" />
<script src="js/jquery-1.3.2.min.js"></script>
<script>
	$(document).ready(function() {

		$("a").click(function() {
			var oID = $(this).attr("id");
			$('#labelId').text("Id " + oID);
			$('#labelTitulo').text("Titulo " + oID);
			$('#labelDescripcion').text("Descripcion " + oID);
		});

	});
	$(window).load(function() {
		/*	$("#menu11").addClass("inactive"); //discutirIdeas.jsp
			$("#menu12").addClass("active"); //registrarReuniones.jsp
			$("#menu21").addClass("inactive"); //buscarIdeas.jsp
			$("#menu22").addClass("inactive"); //evaluarIdeas.jsp
			$("#menu31").addClass("inactive"); //
			$("#menu32").addClass("inactive"); //*/
	});
</script>

</head>
<body>
	<jsp:include page="cabecera.jsp" flush="true" />

	<!-- Ejemplo 2 - Tablet Grid -->
	<div class="container">

		<form class="form-horizontal well" method="post"
			action="RegistrarIdeasServlet">
			<div class="table-responsive">
				<div class="alert alert-info alert-coupon" align="center"
					style="font-weight: bold;">.:. REGISTRO REUNIONES .:.</div>

				<div class="panel panel-default">
					<div class="panel-heading">Panel</div>
					<div class="panel-body">
						<table class="table" cellpadding="0" cellspacing="0">
							<thead>
								<tr>
									<th class="success">&nbsp;</th>
									<th class="success">Item</th>
									<th class="success">Titulo</th>
									<th class="success">Descripci&oacute;n</th>
									<th class="success">Avance</th>
								</tr>
							</thead>
							<tbody>
							<%
								Usuario beanusuario = (Usuario) session.getAttribute("USUARIO_ACTUAL");
										
								ArrayList<Idea> beanidea = (ArrayList<Idea>) request.getAttribute("lstReuniones");
								Iterator<Idea> ideaIterator = beanidea.iterator();
								int a = 1;
								while (ideaIterator.hasNext()) {
									Idea elemento = ideaIterator.next();
							%>
								<tr class='warning'>
									<td width='10px'><img alt='Brand' src='img/asesor.jpg' width='30' height='30'></td>
									<td><%= elemento.getIdIdea() %></td>
									<td><label style='font-style: oblique; color: blue;'>
											<a	href="<%=request.getContextPath()%>/CargaReunionesServlet?subTitulo=<%= elemento.getTituloIdea() %>&usuario=<%= beanusuario.getIdUsuario() %>&codigo=<%= elemento.getIdIdea() %>"><%= elemento.getTituloIdea() %></a>
									</label></td>
									<td><label style="font-style: normal; color: gray;"><%= elemento.getDescripcionIdea() %></label></td>
									<%
									
									Iterator<Reunion> ReunionIterator = (Iterator<Reunion>) elemento.getObjreunion().iterator();
									while (ReunionIterator.hasNext()) {
										calificadoAsesor=1;
										Reunion elemreunion = ReunionIterator.next();
									%><td><label style="font-style: normal; color: gray;"><%= elemreunion.getCalificacion() %></label></td>
									<%
									}
									
									if (calificadoAsesor==0) {
									%>
										<td><label style="font-style: normal; color: gray;" >-----</label></td>
									<%
									}
									%>									
								</tr>
								<%
								}
								
								%>
							</tbody>
						</table>
					</div>
					<!-- fin panel-heading -->
					<div class="panel-footer" id="msgError" name="msgError">
						<label style="color: blue"><%= request.getAttribute("servletMsg")%></label>
					</div>
				</div>
				<!-- fin panel-body -->

			</div>
		</form>
	</div>

</body>
</html>